package com.otsdemo.controller;

import com.otsdemo.common.Result;
import com.otsdemo.entity.Homework;
import com.otsdemo.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/teacher")
public class TeacherController {
    @Autowired
    private TeacherService teacherService;

    @PostMapping("/upload")
    public Result uploadVideo(String videoPath){
        return teacherService.uploadVideo(videoPath)?Result.suc():Result.fail();
    }
    @GetMapping("/correct")
    public List<Homework> correctingHomework(){
        List<Homework> homeworks = teacherService.getHomework();
        return homeworks;
    }
}
